﻿using Furion;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TulingMember.Core;

namespace TulingMember.Application.ViewModel
{
    public class SaleOrderQueryViewModel
    {
        public long Id { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual DateTimeOffset? CreatedTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public virtual DateTimeOffset? UpdatedTime { get; set; }

        /// <summary>
        /// 创建者Id
        /// </summary>
        public virtual long CreatedUserId { get; set; }

        /// <summary>
        /// 创建者名称
        /// </summary>
        public string CreatedUserName { get; set; }

        /// <summary>
        /// 修改者Id
        /// </summary>
        public long? UpdatedUserId { get; set; }

        /// <summary>
        /// 修改者名称
        /// </summary>
        public string UpdatedUserName { get; set; }

        /// <summary>
        /// 软删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;
        public string OrderNo { get; set; }

        public DateTime? OrderDate { get; set; }

        public long CustomerId { get; set; }

        public cts_Customer Customer { get; set; }

        public string CustomerName { get; set; }

        public int CustomerAge { get; set; }

        public string OrderDesc { get; set; }

        /// <summary>
        /// 件数合计
        /// </summary>
        public int Num { get; set; }

        /// <summary>
        /// 重量合计
        /// </summary>
        public decimal Weight { get; set; }

        /// <summary>
        /// 合计。
        /// </summary>
        public decimal Amount { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal FreightFee { get; set; }
        /// <summary>
        /// 版费
        /// </summary>
        public decimal EditionFee { get; set; }

        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal GiveupFee { get; set; }

        /// <summary>
        /// 最终费用合计
        /// </summary>
        public decimal AllFee { get; set; }

        public decimal PayFee { get; set; }

        /// <summary>
        /// 客户当前欠款
        /// </summary>

        public decimal CustomerBalance { get; set; }
        /// <summary>
        /// 备注
        /// </summary>

        public string Remark { get; set; }

        /// <summary>
        /// 状态0.待审核1.已审核,2暂存,3退回
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 打印次数
        /// </summary>
        public int PrintNum { get; set; }

        /// <summary>
        /// 症状
        /// </summary>
        public string Symptom { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        public DateTime Birthday { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public string Sex { get; set; }

        /// <summary>
        /// 医保号
        /// </summary>
        public string MedicalCardNo { get; set; }

        /// <summary>
        /// 部门
        /// </summary>
        public string DepartmentName { get; set; }

        ///// <summary>
        ///// 年龄
        ///// </summary>
        ////public int Age => GetAge();

        ////public int GetAge()
        ////{
        ////    DateTime now = DateTime.Today;

        ////    int age = now.Year - Birthday.Year;

        ////    if (Birthday.Date > now.AddYears(-age)) age--;

        ////    return age;
        ////}
    }
}
